package carshow;


import org.quickserver.net.server.*;
import java.io.*;
import org.quickserver.net.AppException;

/**
 * The authenticator class used by QuickServer to provide secure
 * communication with the server.  This is currenly unused but is
 * planned for future use in a secure implementation of the CarShow
 * application.
 * @author A Shetty (QuickServer dev) with modfications by W Motycka
 */
public class SQLiteQSAuthenticator extends QuickAuthenticator {
	/**
	 * 
	 */
		public boolean askAuthorisation(ClientHandler clientHandler) 
			throws IOException, AppException {
		String username = askStringInput(clientHandler, "User Name :");
		//no need to check for null done by QuickAuthenticator

		String password = askStringInput(clientHandler, "Password :");
		//no need to check for null done by QuickAuthenticator
			
		if(username.equals(password)) {
			sendString(clientHandler, "Auth OK");
			return true;
		} else {
			sendString(clientHandler, "Auth Failed");
			return false;
		}
	}
}
